<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>修改密码 - 义务教育报告生成平台</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    {% load static %}
    <link rel="stylesheet" href="{% static 'css/index.css' %}">
    <script src="https://cdn.tailwindcss.com"></script>
</head>
<body class="bg-gray-50 p-8">
<div class="max-w-xl mx-auto bg-white p-8 rounded-xl shadow ">
    <h1 class="text-2xl font-bold text-indigo-700 mb-6">修改密码</h1>


    <form method="post" class="space-y-4" action="{% url 'change_pwd' %}">
        <div>
            <label for="old_password" class="block text-sm font-medium text-gray-700">原密码</label>
            <input type="password" name="old_password" id="old_password" required
                   class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm p-2 focus:ring-indigo-500 focus:border-indigo-500">
        </div>

        <div>
            <label for="new_password1" class="block text-sm font-medium text-gray-700">新密码</label>
            <input type="password" name="new_password1" id="new_password1" required
                   class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm p-2 focus:ring-indigo-500 focus:border-indigo-500">
        </div>

        <div>
            <label for="new_password2" class="block text-sm font-medium text-gray-700">确认新密码</label>
            <input type="password" name="new_password2" id="new_password2" required
                   class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm p-2 focus:ring-indigo-500 focus:border-indigo-500">
        </div>
        {% if error %}
            <div class="mb-4 text-sm text-red-600">{{ error }}</div>
        {% endif %}
        {% if context %}
            <div class="mb-4 text-sm text-blue-600">{{ context }}</div>
        {% endif %}
        <div class="pt-4">
            <button type="submit"
                    class="w-full py-2 px-4 bg-indigo-600 text-white rounded hover:bg-indigo-700 transition">
                提交修改
            </button>
        </div>
    </form>
</div>
</body>
</html>
